import type {MdFile} from "@/model/dataModel"


//获取指定路径的md文件列表
export const getFileData = (filedata:Array<MdFile>) => {
  const res = import.meta.glob("@/mdfile/*/*.md", { eager: true })
  Object.entries(res).forEach(([path, definition]: any) => {
    const fileName: string = path.substr(path.lastIndexOf('/') + 1)
    const mdObj: MdFile = {
      path: path,
      name: fileName,
      data: "",
      definitionData: definition.default
    }
    filedata.push(mdObj)
  })
}